package puzzle.core;

/** Denotes the direction an entity is facing. */
public enum Direction {
  UP(360),
  RIGHT(90),
  DOWN(180),
  LEFT(270),
  NONE(0);
  
  private int angle;

  Direction(int angle) {
    this.angle = angle;
  }
  
  public int getAngle() {
    return angle;
  }
  
  //clockwise
  public Direction rotate() {
    switch (this) {
      case UP: return RIGHT;
      case RIGHT: return DOWN;
      case DOWN: return LEFT;
      case LEFT: return UP;
      case NONE: return NONE;
      default: return NONE;
    }
  }
}
